package visualizer.client.widgets.messageBox;

import com.google.gwt.user.client.ui.Widget;

/**
 * User: DDovzhenko
 * Date: 26.01.14
 * Time: 12:58
 */
public class MessageBoxPresenter {
    private Display view;

    public MessageBoxPresenter(Display view) {
        this.view = view;
    }

    public void setMessage(String message) {
        view.setMessage(message);
    }

    public void show() {
        view.setVisibility(true);
    }

    public void hide() {
        view.setVisibility(false);
    }

    public Widget asWidget() {
        return view.asWidget();
    }

    interface Display {
        Widget asWidget();
        void setMessage(String message);
        void setVisibility(boolean isVisible);
    }
}
